Implement "Create Link" Through DXL

Hi all,
I'm tring to create link between two objects in different modules using dxl, all through the dxl help, only found a function "addLinkModuleDescriptor" to use. My codes are as follows:
 

Folder f = current
string srcName = "/A project/A module/A object"
string tgtName = "/A project/B module/B object"
string lnkName = "/A project/masterLinks"
string desc = "The project's master link"
bool over_ride = false
 
string msg = addLinkModuleDescriptor(f, srcName, tgtName, over_ride, lnkName, desc)
print msg

 


After I run these code, nothing happens, the link didn't created. Also, the "link arrow" wasn't displayed.

Please help me out, I want to create link through dxl and show "link arrow" at the same time.

Wating for your help with great thanks!

Sincerely, Aven

 


Aven_HIT - Wed Feb 24 01:06:54 EST 2010

Re: Implement "Create Link" Through DXL
SystemAdmin - Wed Feb 24 01:37:08 EST 2010

From DXL Help section "Link Creation":

Link operators
Two operators create links, as shown in the following syntax:

Object source -> string linkModuleName -> Object target
Object target <- string linkModuleName <- Object source
The -> operator creates an outgoing link from object source to object target via link module linkModuleName. If linkModuleName is omitted the link goes via the default link module (see Default link module.

The <- operator creates an incoming link from object source to object target via link module linkModuleName. If linkModuleName is omitted the link goes via the default link module.

These operators are also used in the for loops defined in Finding links.

Example
This example creates a link from the current object of the current module to the first object of module target via the link module tested by.

(current Object) -> "tested by" -> (first read "target")
This example creates a link to the current object of the current module from the first object of module source via the link module tested by. Because links are stored in the source module, you must open source for editing to allow the link to be created.

(current Object) <- "tested by" <- (first edit "source")

Re: Implement "Create Link" Through DXL
llandale - Wed Feb 24 15:06:38 EST 2010

Yup. Also, its of type 'Link':
 

noError()
Link lnk = oSource ->NameFull_LinkMod ->oTarget
string ErrMess = lastError()
if (null lnk or !null ErrMess) ...

 


Don't know if you must trap errors or not.

 

 

 

  • Louie

 

 

Re: Implement "Create Link" Through DXL
llandale - Wed Feb 24 15:09:08 EST 2010

Oh yes. The code you show is for creating a LinkModuleDescriptor, or LinkSetPairing, or Default Link Module for a pair of Modules. That doesn't create a link. That doesn't even create a link set, just information defining where, by default, future links created will go.

  • Louie